1 <?php
2 // DB credentials.

3 define(
'DB_HOST','localhost');
4 define(
'DB_USER','root');
5 define(
'DB_PASS','');
6 define(
'DB_NAME','tms');
7 // Establish database connection.

8 try

9 {
10 $dbh =
new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER, DB_PASS,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));
11 }

12 catch
(PDOException $e)
13 {
14 exit(
"Error: " . $e->getMessage());
15 }
16 ?>


Gõ tìm kiếm nhanh...